<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"  %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	String id = request.getParameter("id");
	String targetLanguage = request.getParameter("target");
%>
org.languageguide.user.User user = org.languageguide.user.UserManager.getUser(session);
if (user == null){
	String uri = request.getRequestURI();
	String queryString = request.getQueryString();
	session.setAttribute("redirect_url", uri + "?" + queryString);
	response.sendRedirect("/user/login.jsp");
}
<%
org.languageguide.readings.TranslatedReading reading = org.languageguide.readings.ReadingManager.getReading(id, targetLanguage);
boolean published = reading.publish();
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reading</title>
</head>
<body>
<% if (published){ %>
	Reading published successfully
<% } else{ %>
	Error publishing
<% } %>
</body>
</html>